﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MetaTracker.ViewModel;
using System.Diagnostics;

namespace MetaTracker.View
{
    /// <summary>
    /// Interaction logic for ExerciseServiceView.xaml
    /// </summary>
    public partial class ExerciseServiceView : UserControl
    {
        public ExerciseServiceView()
        {
            InitializeComponent();

            if (DataContext == null || !(DataContext is ExerciseServiceViewModel))
            {
                DataContext = new ExerciseServiceViewModel();
            }


        }
        #region EventHandeling
        private void ExerciseServiceView_Loaded(object sender, RoutedEventArgs e)
        {
            if (DataContext != null && (DataContext is ExerciseServiceViewModel))
                (DataContext as ExerciseServiceViewModel).InitializeData();
        }
        private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
        {
            Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
            e.Handled = true;
        }
        #endregion //EventHandeling
    }
}
